<?php
declare(strict_types=1);

namespace Zms\Guard;
/*
 * 系统统一密码生产和验证
 */
class Password
{
    /**
     * 系统全局密码加密哈希
     * @param string $password
     * @return string
     */
    public static function hash(string $password): string
    {
        return password_hash($password, PASSWORD_BCRYPT);
    }

    /**
     * 验证密码哈希
     * @param $password
     * @param $passwordHas
     * @return bool
     */
    public static function verify($password, $passwordHas): bool
    {
        return password_verify($password, $passwordHas);
    }
}